package com.sec.etech.ism.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sec.etech.ism.mapper.IsmAppSettingMapper;
import com.sec.etech.ism.model.IsmAppSetting;
import org.springframework.stereotype.Service;

@Service
public class IsmAppSettingService extends ServiceImpl<IsmAppSettingMapper, IsmAppSetting> {

    /**
     * 根据账号和类型获取
     * @param code
     * @return
     */
    public IsmAppSetting getByCode(String code){
        return this.getBaseMapper().selectOne(Wrappers.<IsmAppSetting>lambdaQuery()
                .eq(IsmAppSetting::getCode, code)
                .eq(IsmAppSetting::getActive, 1));
    }
}
